package server.demo.dto;

import server.demo.entity.Ticket;
import java.math.BigDecimal;
import java.time.LocalDateTime;

public class TicketDTO {
    private Long id;
    private Long orderId;
    private String orderNumber;
    private String trainNumber;
    private String carriageNumber;
    private String seatNumber;
    private String passengerName;
    private String passengerIdCard;
    private String startStationName;
    private String endStationName;
    private LocalDateTime departureTime;
    private LocalDateTime arrivalTime;
    private BigDecimal ticketPrice;
    private String ticketStatus;
    private LocalDateTime createdAt;
    
    public TicketDTO() {}
    
    public TicketDTO(Ticket ticket) {
        this.id = ticket.getId();
        this.orderId = ticket.getOrder().getId();
        this.orderNumber = ticket.getOrder().getOrderNumber();
        this.trainNumber = ticket.getTrain().getTrainNumber();
        this.carriageNumber = ticket.getSeat().getCarriage().getCarriageNumber().toString();
        this.seatNumber = ticket.getSeat().getSeatNumber();
        this.passengerName = ticket.getPassengerName();
        this.passengerIdCard = ticket.getPassengerIdCard();
        this.startStationName = ticket.getStartStation().getStationName();
        this.endStationName = ticket.getEndStation().getStationName();
        this.departureTime = ticket.getDepartureTime();
        this.arrivalTime = ticket.getArrivalTime();
        this.ticketPrice = ticket.getTicketPrice();
        this.ticketStatus = ticket.getTicketStatus().name();
        this.createdAt = ticket.getCreatedAt();
    }
    
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public Long getOrderId() {
        return orderId;
    }
    
    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }
    
    public String getOrderNumber() {
        return orderNumber;
    }
    
    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
    }
    
    public String getTrainNumber() {
        return trainNumber;
    }
    
    public void setTrainNumber(String trainNumber) {
        this.trainNumber = trainNumber;
    }
    
    public String getCarriageNumber() {
        return carriageNumber;
    }
    
    public void setCarriageNumber(String carriageNumber) {
        this.carriageNumber = carriageNumber;
    }
    
    public String getSeatNumber() {
        return seatNumber;
    }
    
    public void setSeatNumber(String seatNumber) {
        this.seatNumber = seatNumber;
    }
    
    public String getPassengerName() {
        return passengerName;
    }
    
    public void setPassengerName(String passengerName) {
        this.passengerName = passengerName;
    }
    
    public String getPassengerIdCard() {
        return passengerIdCard;
    }
    
    public void setPassengerIdCard(String passengerIdCard) {
        this.passengerIdCard = passengerIdCard;
    }
    
    public String getStartStationName() {
        return startStationName;
    }
    
    public void setStartStationName(String startStationName) {
        this.startStationName = startStationName;
    }
    
    public String getEndStationName() {
        return endStationName;
    }
    
    public void setEndStationName(String endStationName) {
        this.endStationName = endStationName;
    }
    
    public LocalDateTime getDepartureTime() {
        return departureTime;
    }
    
    public void setDepartureTime(LocalDateTime departureTime) {
        this.departureTime = departureTime;
    }
    
    public LocalDateTime getArrivalTime() {
        return arrivalTime;
    }
    
    public void setArrivalTime(LocalDateTime arrivalTime) {
        this.arrivalTime = arrivalTime;
    }
    
    public BigDecimal getTicketPrice() {
        return ticketPrice;
    }
    
    public void setTicketPrice(BigDecimal ticketPrice) {
        this.ticketPrice = ticketPrice;
    }
    
    public String getTicketStatus() {
        return ticketStatus;
    }
    
    public void setTicketStatus(String ticketStatus) {
        this.ticketStatus = ticketStatus;
    }
    
    public LocalDateTime getCreatedAt() {
        return createdAt;
    }
    
    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }
}